<template>
  <div>
    <br />
    <br />
    <div class="bottom">
      <p>
        <input
          :checked="checkFlag"
          @change="checkBtn"
          type="checkbox"
          name=""
          id=""
        />
      </p>
      <p>总价</p>
      <p>去支付</p>
      <p @click="removeBtn">
        删除选中()
      </p>
    </div>
  </div>
</template>

<script>
import { useStore, mapState } from "vuex";
import { computed } from "vue";
export default {
  setup(props) {
    let store = useStore();

    function checkBtn() {
      store.commit("checkAll", event.target.checked);
    }
    function removeBtn() {
      store.commit("removeAll");
    }
    return {
      checkBtn,
      removeBtn,
    };
  },
  computed: {
    ...mapState(["checkFlag"]),
  },
};
</script>

<style lang="scss" scoped>
[type="checkbox"] {
  width: 20px;
  height: 20px;
}
.bottom {
  width: 100%;
  height: 40px;
  background-color: rgb(240, 33, 33);
  display: flex;
  align-items: center;
  justify-content: space-around;
  color: #fff;
  position: fixed;
  bottom: 0;
  left: 0;
}
</style>
